package com.yuyou.train.user.mapper;

import com.yuyou.train.user.vo.resp.RespUserRaiseTop;

import org.apache.ibatis.annotations.Mapper;

import com.yuyou.train.service.api.user.entity.UserPraise;

import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserPraiseMapper {
    int deleteByPrimaryKey(String id);
    
    int deleteByfForeignId(String foreignId); 

    int insert(UserPraise record);

    UserPraise selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(UserPraise record);

    List<UserPraise> findUserPraiseByForeignId(String foreignId);

    UserPraise findPraiseByForeignIdAndUserId(@Param(value = "foreignId")String foreignId, @Param(value = "userId")String userId);

    int deleteByfForeignIdUserId(@Param(value = "foreignId") String foreignId, @Param(value = "userId") String userId);

    Long sumByForeignId(@Param(value = "foreignId") String foreignId,@Param(value = "isPraise") String isPraise);

    List<RespUserRaiseTop> findHwPraiseTop(@Param(value = "classId")String classId, @Param(value = "isPraise")String isPraise);
    
    UserPraise selectUserPraise(
    		@Param(value = "foreignId") String foreignId, 
    		@Param(value = "userId") String userId,
    		@Param(value = "resourceType") String resourceType,
    		@Param(value = "isPraise") String isPraise);

}